using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace AnyOffice.Web.publicfile
{
    public partial class index : System.Web.UI.Page
    {
        public string op = string.Empty;
        public string attachmentid = string.Empty;
        public string filename = string.Empty;
        public string username = string.Empty;
        public string url = string.Empty;
        public bool isword = false;
        public bool isppt = false;
        public string fileType = string.Empty;

        public DataTable dtbSign = new DataTable();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if (Request.QueryString["attachment_id"] != null && Request.QueryString["name"] != null && Request.QueryString["op"] != null)
                {
                    op = Request.QueryString["op"].ToString();
                    attachmentid = Request.QueryString["attachment_id"].ToString();
                    filename = Request.QueryString["name"].ToString();
                    username = base.User.Identity.Name;

                    url = "/readdisk.aspx?attachment_id=" + attachmentid + "&name=" + Server.UrlEncode(filename);
                    //url = "http://localhost/anyoffice/module/oc/readdisk.aspx?attachment_id=" + attachmentid + "&name=" + filename;

                    if (filename.EndsWith(".doc") || filename.EndsWith(".docx"))
                    {
                        isword = true;
                        fileType = "doc";

                    }
                    else if (filename.EndsWith(".xls") || filename.EndsWith(".xlsx"))
                    {
                        isword = true;

                        fileType = "xls";
                    }
                    else if (filename.EndsWith(".ppt") || filename.EndsWith(".pptx"))
                    {
                        isppt = true;
                        fileType = "ppt";
                    }

                    // dtbSign = new AnyOffice.BLL.Flow_Sign().GetAllList().Tables[0];

                }
            }
        }
    }
}
